package com.example.cachetext.repository;

import com.example.cachetext.entity.Comment;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import javax.transaction.Transactional;

public interface CommentRepository extends JpaRepository<Comment,Integer> {

    @Query(value = "UPDATE t_comment set content=?2 where id=?1",nativeQuery = true)
    @Modifying
    @Transactional
    public int updateComment(Integer Id,String content);
}
